package com.cxx.food.service.impl;


import com.cxx.food.constant.BizType;
import com.cxx.food.entity.CommentRecord;
import com.cxx.food.mapper.CommentRecordMapper;
import com.cxx.food.service.CommentService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;


@Service
public class CommentServiceImpl implements CommentService {
    @Resource
    private CommentRecordMapper commentRecordMapper;

    @Override
    public Boolean addComment(BizType type, Long subjectId, String content) {
        CommentRecord comment = new CommentRecord();
        comment.setType(type.getCode());
        comment.setContent(content);
        comment.setSubjectId(subjectId);
        return commentRecordMapper.insert(comment) == 1;
    }
}
